package java学习.第05章_数组;

import java.util.Scanner;

/**
 * ClassName: D_数组案例
 * Package: java学习.第05章_数组
 * Description:
 *
 * @Author 张蛟龙
 * @Create 2023/3/2 20:02
 * @Version 1.0
 */
public class D_数组案例 {
    public static void main(String[] args) {
        System.out.print("请输入学生人数：");
        Scanner scanner = new Scanner(System.in);
        int i = scanner.nextInt();
        int[] is = new int[i];
        int max = Integer.MIN_VALUE;
        System.out.println("请输入" + is.length + "个成绩：");
        for (int j = 0; j < is.length; j++) {
            is[j] = scanner.nextInt();
            max = Math.max(is[j],max);
        }
        System.out.println("最高分为：" + max);
        for (int j = 0; j < is.length; j++) {
            System.out.print("学生" + j + "成绩是" + is[j] + "评分是：");
            if(is[j] >= max-10){
                System.out.println("A");
            }else if(is[j] >= max-10){
                System.out.println("B");
            }else if(is[j] >= max-10){
                System.out.println("C");
            }else {
                System.out.println("D");
            }
        }

    }
}
